.carousel-container {
    position: relative;
    width: 100%;
    overflow: hidden;
}
.carousel-items {
    display: flex;
    width: calc(100% * 3); /* 假设我们有3张图片 */
    animation: carousel-slide 5s ease infinite; /* 自定义动画 */
}
.carousel-item {
    width: 100%;
    transition: transform 0.5s ease;
}
.carousel-item.active {
    transform: translateX(0);
}
.carousel-item.next,
.carousel-item.prev {
    transform: translateX(-100%);
}
@keyframes carousel-slide {
    0% { transform: translateX(0); }
    33.33% { transform: translateX(-100%); }
    66.66% { transform: translateX(-200%); }
    100% { transform: translateX(0); }
}

/* 控制按钮和指示器样式 */
.carousel-indicators {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 15;
    display: flex;
    justify-content: center;
    list-style: none;
}

.carousel-indicators li {
    box-sizing: content-box;
    flex: 0 1 auto;
    width: 10px;
    height: 10px;
    margin-right: 3px;
    margin-left: 3px;
    text-indent: -999px;
    cursor: pointer;
    background-color: rgba(255, 255, 255, 0.5);
    border-radius: 50%;
}

.carousel-indicators .active {
    background-color: #fff;
}

body {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh; /* 确保body高度为视窗高度 */
    margin: 0;
    padding: 0;
}


/* 或者使用CSS Grid布局实现居中 */
body {
    display: grid;
    place-items: center;
    height: 100vh; /* 确保body高度为视窗高度 */
    margin: 0;
    padding: 0;
}


.carousel-control-prev,
.carousel-control-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 1;
    width: 40px;
    height: 40px;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: rgba(0, 0, 0, 0.5);
    border-radius: 50%;
    color: #fff;
    text-align: center;
    cursor: pointer;
    opacity: 0.5;
    transition: opacity 0.3s ease;
}

.carousel-control-prev::before,
.carousel-control-next::before {
    font-family: 'Font Awesome 5 Free';
    font-weight: 900;
    content: '\f104'; /* 左箭头 */
}

.carousel-control-next::before {
    content: '\f105'; /* 右箭头 */
}

.carousel-control-prev:hover,
.carousel-control-next:hover {
    opacity: 1;
}